package com.ssyt.yt1.day14.innerclass.a;

/**
 * <pre>
 * 成员内部类 
 * 1）成员内部类可访问外部类的成员属性或成员方法 
 * 2）成员内部类不能定义static修饰的属性或成员方法
 * </pre>
 * 
 * @author Administrator
 *
 */
class Person {

	private int blood;

	public int getBlood() {
		return blood;
	}

	public void setBlood(int blood) {
		this.blood = blood;
	}

	public class Heart {

		// The field a cannot be declared static in a non-static inner type
		// public static int a = 0;

		public void get() {
			System.out.println(blood);
		}
	}

}

public class InnerClassDemo {

	public static void main(String[] args) {
		Person person = new Person();
		person.setBlood(100000);

		Person.Heart heart = person.new Heart();
		heart.get();
	}
}
